.class public Lcom/instagram/h/b/h;
.super Ljava/lang/Object;
.source "SurveyToolHelper.java"

# interfaces
.implements Lcom/instagram/h/b/a;


# instance fields
.field private final a:Landroid/os/Handler;

.field private final b:J

.field private final c:Lcom/instagram/b/d;

.field private final d:Lcom/instagram/h/b/g;

.field private final e:Landroid/app/Activity;

.field private f:Lcom/instagram/h/b/b;

.field private g:Landroid/app/Dialog;

.field private h:Z

.field private i:I

.field private j:Z


# direct methods
.method public constructor <init>(Landroid/app/Activity;Lcom/instagram/b/d;Lcom/instagram/h/b/g;)V
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 72
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 69
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/h/b/h;->j:Z

    .line 73
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/instagram/h/b/h;->b:J

    .line 74
    new-instance v0, Lcom/instagram/h/b/m;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/instagram/h/b/m;-><init>(Lcom/instagram/h/b/h;Lcom/instagram/h/b/i;)V

    iput-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    .line 75
    iput-object p1, p0, Lcom/instagram/h/b/h;->e:Landroid/app/Activity;

    .line 76
    iput-object p2, p0, Lcom/instagram/h/b/h;->c:Lcom/instagram/b/d;

    .line 77
    iput-object p3, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    .line 78
    return-void
.end method

.method static synthetic a(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 50
    invoke-static {p0, p1}, Lcom/instagram/h/b/h;->b(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    return-object v0
.end method

.method private a(Landroid/app/Dialog;Lcom/instagram/h/b/b;)V
    .locals 8
    .parameter
    .parameter

    .prologue
    const/4 v7, 0x0

    .line 124
    sget v0, Lcom/facebook/aw;->surveySwitcher:I

    invoke-virtual {p1, v0}, Landroid/app/Dialog;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ViewSwitcher;

    .line 125
    sget v1, Lcom/facebook/aw;->thanksCircle:I

    invoke-virtual {v0, v1}, Landroid/widget/ViewSwitcher;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    .line 126
    sget v2, Lcom/facebook/aw;->surveyList:I

    invoke-virtual {v0, v2}, Landroid/widget/ViewSwitcher;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/ListView;

    .line 128
    sget v3, Lcom/facebook/aw;->button_cancel:I

    invoke-virtual {p1, v3}, Landroid/app/Dialog;->findViewById(I)Landroid/view/View;

    move-result-object v3

    new-instance v4, Lcom/instagram/h/b/j;

    invoke-direct {v4, p0, p1}, Lcom/instagram/h/b/j;-><init>(Lcom/instagram/h/b/h;Landroid/app/Dialog;)V

    invoke-virtual {v3, v4}, Landroid/view/View;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 136
    iget-object v3, p0, Lcom/instagram/h/b/h;->e:Landroid/app/Activity;

    sget v4, Lcom/facebook/ax;->sentiment_tool_question:I

    invoke-static {v3, v4, v7}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v3

    check-cast v3, Landroid/view/ViewGroup;

    .line 139
    sget v4, Lcom/facebook/aw;->title:I

    invoke-virtual {v3, v4}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v4

    check-cast v4, Landroid/widget/TextView;

    .line 140
    sget v5, Lcom/facebook/aw;->subtitle:I

    invoke-virtual {v3, v5}, Landroid/view/ViewGroup;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    .line 141
    invoke-virtual {p2}, Lcom/instagram/h/b/b;->b()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 142
    invoke-virtual {p2}, Lcom/instagram/h/b/b;->c()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 143
    invoke-virtual {p2}, Lcom/instagram/h/b/b;->c()Ljava/lang/String;

    move-result-object v6

    invoke-static {v6}, Lcom/facebook/c/i/c;->a(Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_0

    .line 144
    sget-object v6, Landroid/graphics/Typeface;->DEFAULT:Landroid/graphics/Typeface;

    invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

    .line 145
    const/16 v4, 0x8

    invoke-virtual {v5, v4}, Landroid/widget/TextView;->setVisibility(I)V

    .line 147
    :cond_0
    const/4 v4, 0x0

    invoke-virtual {v2, v3, v7, v4}, Landroid/widget/ListView;->addHeaderView(Landroid/view/View;Ljava/lang/Object;Z)V

    .line 148
    new-instance v3, Lcom/instagram/h/b/e;

    iget-object v4, p0, Lcom/instagram/h/b/h;->e:Landroid/app/Activity;

    invoke-direct {v3, v4, p2}, Lcom/instagram/h/b/e;-><init>(Landroid/content/Context;Lcom/instagram/h/b/b;)V

    invoke-virtual {v2, v3}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 149
    new-instance v3, Lcom/instagram/h/b/k;

    invoke-direct {v3, p0, v1, v0, p2}, Lcom/instagram/h/b/k;-><init>(Lcom/instagram/h/b/h;Landroid/widget/ImageView;Landroid/widget/ViewSwitcher;Lcom/instagram/h/b/b;)V

    invoke-virtual {v2, v3}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 170
    new-instance v0, Lcom/instagram/h/b/l;

    invoke-direct {v0, p0, p2}, Lcom/instagram/h/b/l;-><init>(Lcom/instagram/h/b/h;Lcom/instagram/h/b/b;)V

    invoke-virtual {p1, v0}, Landroid/app/Dialog;->setOnShowListener(Landroid/content/DialogInterface$OnShowListener;)V

    .line 185
    return-void
.end method

.method static synthetic a(Lcom/instagram/h/b/h;)V
    .locals 0
    .parameter

    .prologue
    .line 50
    invoke-direct {p0}, Lcom/instagram/h/b/h;->c()V

    return-void
.end method

.method static synthetic a(Lcom/instagram/h/b/h;Z)Z
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 50
    iput-boolean p1, p0, Lcom/instagram/h/b/h;->j:Z

    return p1
.end method

.method private static b(Landroid/content/Context;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;
    .locals 2
    .parameter
    .parameter

    .prologue
    .line 188
    invoke-virtual {p0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    .line 189
    const-string v1, "green"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 190
    sget v1, Lcom/facebook/av;->circlegreen:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    .line 200
    :goto_0
    return-object v0

    .line 191
    :cond_0
    const-string v1, "lightgreen"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 192
    sget v1, Lcom/facebook/av;->circlelightgreen:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    goto :goto_0

    .line 193
    :cond_1
    const-string v1, "yellow"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_2

    .line 194
    sget v1, Lcom/facebook/av;->circleyellow:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    goto :goto_0

    .line 195
    :cond_2
    const-string v1, "orange"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_3

    .line 196
    sget v1, Lcom/facebook/av;->circleorange:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    goto :goto_0

    .line 197
    :cond_3
    const-string v1, "red"

    invoke-virtual {v1, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_4

    .line 198
    sget v1, Lcom/facebook/av;->circlered:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    goto :goto_0

    .line 200
    :cond_4
    sget v1, Lcom/facebook/av;->circlegray:I

    invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getDrawable(I)Landroid/graphics/drawable/Drawable;

    move-result-object v0

    goto :goto_0
.end method

.method static synthetic b(Lcom/instagram/h/b/h;)Z
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-boolean v0, p0, Lcom/instagram/h/b/h;->j:Z

    return v0
.end method

.method static synthetic c(Lcom/instagram/h/b/h;)Landroid/app/Activity;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/instagram/h/b/h;->e:Landroid/app/Activity;

    return-object v0
.end method

.method private c()V
    .locals 2

    .prologue
    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 113
    iput-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    .line 114
    iput-object v0, p0, Lcom/instagram/h/b/h;->f:Lcom/instagram/h/b/b;

    .line 115
    iput-boolean v1, p0, Lcom/instagram/h/b/h;->j:Z

    .line 116
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 117
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 118
    iget-object v0, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    if-eqz v0, :cond_0

    .line 119
    iget-object v0, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    invoke-interface {v0, p0}, Lcom/instagram/h/b/g;->b(Lcom/instagram/h/b/a;)V

    .line 121
    :cond_0
    return-void
.end method

.method static synthetic d(Lcom/instagram/h/b/h;)Lcom/instagram/b/d;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/instagram/h/b/h;->c:Lcom/instagram/b/d;

    return-object v0
.end method

.method private d()V
    .locals 4

    .prologue
    const/4 v3, 0x1

    .line 219
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    invoke-virtual {v0, v3}, Landroid/os/Handler;->removeMessages(I)V

    .line 220
    iget v0, p0, Lcom/instagram/h/b/h;->i:I

    if-nez v0, :cond_0

    iget-boolean v0, p0, Lcom/instagram/h/b/h;->h:Z

    if-nez v0, :cond_0

    .line 221
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    invoke-direct {p0}, Lcom/instagram/h/b/h;->e()I

    move-result v1

    int-to-long v1, v1

    invoke-virtual {v0, v3, v1, v2}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 223
    :cond_0
    return-void
.end method

.method private e()I
    .locals 8

    .prologue
    .line 245
    const-wide/16 v0, 0x7d0

    const-wide/16 v2, 0x3a98

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    iget-wide v6, p0, Lcom/instagram/h/b/h;->b:J

    sub-long/2addr v4, v6

    sub-long/2addr v2, v4

    invoke-static {v0, v1, v2, v3}, Ljava/lang/Math;->max(JJ)J

    move-result-wide v0

    long-to-int v0, v0

    return v0
.end method

.method static synthetic e(Lcom/instagram/h/b/h;)Landroid/os/Handler;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    return-object v0
.end method

.method static synthetic f(Lcom/instagram/h/b/h;)Landroid/app/Dialog;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    return-object v0
.end method

.method private f()Z
    .locals 2

    .prologue
    const/4 v0, 0x1

    .line 261
    iget-object v1, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    if-eqz v1, :cond_0

    iget-object v1, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    invoke-interface {v1}, Lcom/instagram/h/b/g;->r()Z

    move-result v1

    if-nez v1, :cond_1

    :cond_0
    :goto_0
    return v0

    :cond_1
    const/4 v0, 0x0

    goto :goto_0
.end method

.method static synthetic g(Lcom/instagram/h/b/h;)Z
    .locals 1
    .parameter

    .prologue
    .line 50
    invoke-direct {p0}, Lcom/instagram/h/b/h;->f()Z

    move-result v0

    return v0
.end method

.method static synthetic h(Lcom/instagram/h/b/h;)Lcom/instagram/h/b/b;
    .locals 1
    .parameter

    .prologue
    .line 50
    iget-object v0, p0, Lcom/instagram/h/b/h;->f:Lcom/instagram/h/b/b;

    return-object v0
.end method

.method static synthetic i(Lcom/instagram/h/b/h;)V
    .locals 0
    .parameter

    .prologue
    .line 50
    invoke-direct {p0}, Lcom/instagram/h/b/h;->d()V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 1

    .prologue
    .line 226
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/h/b/h;->h:Z

    .line 227
    iget-object v0, p0, Lcom/instagram/h/b/h;->f:Lcom/instagram/h/b/b;

    if-eqz v0, :cond_0

    .line 228
    iget-object v0, p0, Lcom/instagram/h/b/h;->f:Lcom/instagram/h/b/b;

    invoke-virtual {p0, v0}, Lcom/instagram/h/b/h;->b(Lcom/instagram/h/b/b;)V

    .line 230
    :cond_0
    return-void
.end method

.method public a(I)V
    .locals 0
    .parameter

    .prologue
    .line 251
    invoke-virtual {p0, p1}, Lcom/instagram/h/b/h;->b(I)V

    .line 252
    invoke-direct {p0}, Lcom/instagram/h/b/h;->d()V

    .line 253
    return-void
.end method

.method public a(Lcom/instagram/h/b/b;)V
    .locals 4
    .parameter

    .prologue
    .line 87
    if-eqz p1, :cond_0

    .line 88
    invoke-virtual {p1}, Lcom/instagram/h/b/b;->e()Lcom/instagram/h/b/d;

    move-result-object v0

    sget-object v1, Lcom/instagram/h/b/d;->b:Lcom/instagram/h/b/d;

    if-ne v0, v1, :cond_1

    .line 89
    iget-object v0, p0, Lcom/instagram/h/b/h;->c:Lcom/instagram/b/d;

    invoke-interface {v0}, Lcom/instagram/b/d;->c_()Z

    move-result v0

    if-nez v0, :cond_1

    .line 90
    invoke-direct {p0}, Lcom/instagram/h/b/h;->c()V

    .line 110
    :cond_0
    :goto_0
    return-void

    .line 94
    :cond_1
    new-instance v0, Lcom/instagram/ui/a/a;

    iget-object v1, p0, Lcom/instagram/h/b/h;->e:Landroid/app/Activity;

    sget v2, Lcom/facebook/ax;->dialog_sentiment_tool:I

    sget v3, Lcom/facebook/bb;->IgDialogActionBar:I

    invoke-direct {v0, v1, v2, v3}, Lcom/instagram/ui/a/a;-><init>(Landroid/content/Context;II)V

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/instagram/ui/a/a;->a(Z)Lcom/instagram/ui/a/a;

    move-result-object v0

    invoke-virtual {v0}, Lcom/instagram/ui/a/a;->b()Landroid/app/Dialog;

    move-result-object v0

    iput-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    .line 99
    iget-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    invoke-direct {p0, v0, p1}, Lcom/instagram/h/b/h;->a(Landroid/app/Dialog;Lcom/instagram/h/b/b;)V

    .line 101
    iget-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    new-instance v1, Lcom/instagram/h/b/i;

    invoke-direct {v1, p0}, Lcom/instagram/h/b/i;-><init>(Lcom/instagram/h/b/h;)V

    invoke-virtual {v0, v1}, Landroid/app/Dialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V

    .line 108
    iget-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    invoke-virtual {v0}, Landroid/app/Dialog;->show()V

    goto :goto_0
.end method

.method public b()V
    .locals 2

    .prologue
    const/4 v1, 0x1

    .line 233
    iput-boolean v1, p0, Lcom/instagram/h/b/h;->h:Z

    .line 234
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 235
    iget-object v0, p0, Lcom/instagram/h/b/h;->a:Landroid/os/Handler;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 236
    iget-object v0, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    if-eqz v0, :cond_0

    .line 237
    iget-object v0, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    invoke-interface {v0, p0}, Lcom/instagram/h/b/g;->b(Lcom/instagram/h/b/a;)V

    .line 239
    :cond_0
    iget-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    if-eqz v0, :cond_1

    .line 240
    iget-object v0, p0, Lcom/instagram/h/b/h;->g:Landroid/app/Dialog;

    invoke-virtual {v0}, Landroid/app/Dialog;->dismiss()V

    .line 242
    :cond_1
    return-void
.end method

.method public b(I)V
    .locals 0
    .parameter

    .prologue
    .line 257
    iput p1, p0, Lcom/instagram/h/b/h;->i:I

    .line 258
    return-void
.end method

.method public b(Lcom/instagram/h/b/b;)V
    .locals 1
    .parameter

    .prologue
    .line 211
    iput-object p1, p0, Lcom/instagram/h/b/h;->f:Lcom/instagram/h/b/b;

    .line 212
    iget-object v0, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    if-eqz v0, :cond_0

    .line 213
    iget-object v0, p0, Lcom/instagram/h/b/h;->d:Lcom/instagram/h/b/g;

    invoke-interface {v0, p0}, Lcom/instagram/h/b/g;->a(Lcom/instagram/h/b/a;)V

    .line 215
    :cond_0
    invoke-direct {p0}, Lcom/instagram/h/b/h;->d()V

    .line 216
    return-void
.end method
